<?php


namespace App\Http\Controllers\Api;
use App\Http\Controllers\BaseController;
use App\Models\Notification;
use Illuminate\Http\Request;

class NotificationController extends BaseController
{

    public function index(Request $request)
    {
        $usr_id = $this->getUserId();
        $users = Notification::withCertain('user', ['nickname', 'avatar_url'])
            ->withCertain('notebook', ['file_path'])->where('entity_user_id', $usr_id)->orderBy("id", "desc")
            ->paginate(\request('per_page', 20));
        return $this->paginate($users);
    }
}

